﻿using System;
using System.Collections.Generic;
using System.Linq;
using Com.PhilChuang.Utils;

namespace Com.PhilChuang.Mobile.Apps.LocationSender.Ui.Views.Impl.ViewModels
{
	public class SelectContactsPageViewModel : AbstractLocationSenderAppViewModel
	{
		public IList<String> Recipients
		{
			get { return myRecipientsString.Split (',', ';').Select (s => s.Trim ()).ToList (); }
			set { myRecipientsString = value.Print ("; "); }
		}

		#region Bindable Properties
		private String myRecipientsString;
		public String RecipientsString
		{
			get { return myRecipientsString; }
			set
			{
				myRecipientsString = value;
				RaisePropertyChanged (() => RecipientsString);
			}
		}
		#endregion

		#region Constructors
		public SelectContactsPageViewModel ()
		{
			myRecipientsString = String.Empty;
		}
		#endregion
	}
}
